package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.db.domain.SourceDataCountInfo;
import com.ruoyi.db.mapper.SourceDataCountInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.source.service.ISourceDataCountInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索数据统计Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-27
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourceDataCountInfoServiceImpl implements ISourceDataCountInfoService 
{
    @Autowired
    private SourceDataCountInfoMapper sourceDataCountInfoMapper;

    /**
     * 查询线索数据统计
     * 
     * @param id 线索数据统计主键
     * @return 线索数据统计
     */
    @Override
    public SourceDataCountInfo selectSourceDataCountInfoById(Long id)
    {
        return sourceDataCountInfoMapper.selectSourceDataCountInfoById(id);
    }

    /**
     * 查询线索数据统计列表
     * 
     * @param sourceDataCountInfo 线索数据统计
     * @return 线索数据统计
     */
    @Override
    public List<SourceDataCountInfo> selectSourceDataCountInfoList(SourceDataCountInfo sourceDataCountInfo)
    {
        return sourceDataCountInfoMapper.selectSourceDataCountInfoList(sourceDataCountInfo);
    }

    /**
     * 查询线索数据统计列表
     *
     * @param sourceDataCountInfo 线索数据统计
     * @return 线索数据统计
     */
    @Override
    public List<Map<String, Object>> selectSourceDataCountInfoListMap(SourceDataCountInfo sourceDataCountInfo)
    {
        return sourceDataCountInfoMapper.selectSourceDataCountInfoListMap(sourceDataCountInfo);
    }

    @Override
    public Map<String, Object> selectSourceDataCountInfoTotalMap(SourceDataCountInfo sourceDataCountInfo)
    {
        return sourceDataCountInfoMapper.selectSourceDataCountInfoTotalMap(sourceDataCountInfo);
    }

    /**
     * 新增线索数据统计
     * 
     * @param sourceDataCountInfo 线索数据统计
     * @return 结果
     */
    @Override
    public int insertSourceDataCountInfo(SourceDataCountInfo sourceDataCountInfo)
    {
        sourceDataCountInfo.setCreateTime(DateUtils.getNowDate());
        return sourceDataCountInfoMapper.insertSourceDataCountInfo(sourceDataCountInfo);
    }

    /**
     * 修改线索数据统计
     * 
     * @param sourceDataCountInfo 线索数据统计
     * @return 结果
     */
    @Override
    public int updateSourceDataCountInfo(SourceDataCountInfo sourceDataCountInfo)
    {
        sourceDataCountInfo.setUpdateTime(DateUtils.getNowDate());
        return sourceDataCountInfoMapper.updateSourceDataCountInfo(sourceDataCountInfo);
    }

    /**
     * 批量删除线索数据统计
     * 
     * @param ids 需要删除的线索数据统计主键
     * @return 结果
     */
    @Override
    public int deleteSourceDataCountInfoByIds(String ids)
    {
        return sourceDataCountInfoMapper.deleteSourceDataCountInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索数据统计信息
     * 
     * @param id 线索数据统计主键
     * @return 结果
     */
    @Override
    public int deleteSourceDataCountInfoById(Long id)
    {
        return sourceDataCountInfoMapper.deleteSourceDataCountInfoById(id);
    }
}
